import 'package:flutter/material.dart';
import 'package:animation/components/appbar_base.dart';
import 'package:animation/generated/l10n.dart';

class AboutList extends StatelessWidget {
  const AboutList({super.key});

  @override
  Widget build(BuildContext context) {
    final List<AboutItem> items = [
      AboutItem(title: S.of(context).b8, subtitle: S.of(context).b9),
      AboutItem(title: S.of(context).b10, subtitle: S.of(context).b11),
      AboutItem(title: S.of(context).b12, subtitle: S.of(context).b13),
      AboutItem(title: S.of(context).b14, subtitle: S.of(context).b15),
      AboutItem(title: S.of(context).b16, subtitle: S.of(context).b18),
      AboutItem(title: S.of(context).b19, subtitle: S.of(context).b20),
      AboutItem(title: S.of(context).b21, subtitle: S.of(context).b22),
      AboutItem(
          title: S.of(context).b23,
          subtitle: '${S.of(context).b24}：3201468129@qq.com'),
      AboutItem(
          title: S.of(context).b25,
          subtitle: 'https://gitee.com/zsnoin-can/new-wall-paper.git'),
    ];
    return Scaffold(
      appBar: AppbarBase(title: S.of(context).about),
      body: Padding(
        padding: const EdgeInsets.all(8),
        child: ListView(
          children: [
            for (var item in items)
              Container(
                margin: const EdgeInsets.only(bottom: 8),
                child: Material(
                  color: Theme.of(context).colorScheme.primaryContainer,
                  borderRadius: BorderRadius.all(Radius.circular(8)),
                  clipBehavior: Clip.antiAlias,
                  child: ListTile(
                    title: Text(item.title),
                    subtitle: Text(item.subtitle),
                    onTap: () {},
                  ),
                ),
              ),
          ],
        ),
      ),
    );
  }
}

class AboutItem {
  final String title;
  final String subtitle;
  const AboutItem({required this.title, required this.subtitle});
}
